package me.send.business.service.mapper;

import me.send.business.service.pojo.Red;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public abstract interface RedMapper {

	// 批量增加 使用方法 2015年6月5日17:10:50
	@Insert(value = "insert into red(descption,money,createtime,popid,status,redtypeid,rednumber) "
			+ "values(#{descption},#{money},#{createtime},#{popid},1,#{redtypeid},#{rednumber})")
	public abstract void save(Red red);

	@Select( { "select redid,descption,money,redtypeid,rednumber,days from red where status = 1 and redtypeid = 1 ORDER BY createtime limit 0,1 " })
	public abstract Red limit_one_red();

	@Update( { "update red set status = 2,updatetime = #{updatetime} where redid = #{redid}" })
	public abstract void update_status_redid(Red paramRed);

}
